package com.myteam.fugaocrm.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PortalController {
	
	@RequestMapping("portal/logout")
	public String logout(HttpServletRequest request, HttpServletResponse response) throws Exception {
	    HttpSession session = request.getSession();
	    session.removeAttribute("staffId");
	    session.removeAttribute("staffName");
	    session.removeAttribute("permission");
	    session.invalidate();
	    return "redirect:/login.jsp";
	}
	
	@RequestMapping("index")
	public String index() {
	    return "login.jsp";
	}
}
